import 'dart:convert';

import 'package:get/get_rx/src/rx_types/rx_types.dart';
import 'package:mziot/generated/json/base/json_field.dart';
import 'package:mziot/generated/json/device_group_entity.g.dart';

@JsonSerializable()
class DeviceGroupEntity {
  List<DeviceGroupList>? list;
  bool? hasNext;

  DeviceGroupEntity();

  factory DeviceGroupEntity.fromJson(Map<String, dynamic> json) => $DeviceGroupEntityFromJson(json);

  Map<String, dynamic> toJson() => $DeviceGroupEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class DeviceGroupList {
  int? id;
  String? groupName;
  String? groupImg;
  int? groupLightRate;
  int? sceneLightRate;
  bool? lockStatus;
  String? sceneName;
  bool? isClose;
  int? deviceNum;

  var isSelected = false.obs;
  var closeState = false.obs;
  var isEmpty = false.obs;
  var isLock = false.obs;

  DeviceGroupList();

  factory DeviceGroupList.fromJson(Map<String, dynamic> json) => $DeviceGroupListFromJson(json);

  Map<String, dynamic> toJson() => $DeviceGroupListToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
